package com.sptpc.demo1.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class HelloController {
    //Restfull 风格的请求
    //经典的http请求 get post
    //新建 post /url(资源)/json(描述新资源)
    //    post/drink/{"name":"奶茶","price":8:00}
    //修改 put/uri(资源)/json(描述原有的资源的修改）
    //    put/drink/{"id":1,"name":"新奶茶“}
    //删除 delete/url(资源)
    //    delete/url(资源)/id
    //    delete/drink/
    //    delete/drink/1
    //查询 get /url(资源)
    //    get /url(资源)/id
    //    get/drink/
    //    get/drink/1

    //get /hello/hi
    @GetMapping("/")
    public  String sayHi(@RequestParam("name")String name){
        return  "欢迎使用Spring Boot!";
    }
}
